package com.googlecode.jerato.common.view;

import java.util.List;

import com.googlecode.jerato.common.data.ColumnListSelect;
import com.googlecode.jerato.core.store.StoreTransaction;
import com.googlecode.jerato.core.view.ViewTransfer;
import com.googlecode.jerato.library.store.StoreService;
import com.googlecode.jerato.library.store.StoreTransactionService;
import com.googlecode.jerato.library.view.xml.XmlView;
import com.googlecode.jerato.core.view.ViewParameters;

public class TableDetailView extends XmlView{
	public void prepare(ViewTransfer trans, ViewParameters input, ViewParameters output){
		String table_name = input.getString("table_name");
		StoreTransaction transaction = StoreTransactionService.beginTransaction();
		List list = StoreService.getInstance().select(trans, ColumnListSelect.class, input);
		transaction.end();
		output.put("table_name", table_name);
		
		output.setObject("columnList", list);
	}

}
